﻿using System;
using System.Globalization;
using System.Windows.Data;
using Boggle.Net.Model;

namespace Boggle.Net.Converters
{
    public class TrayPathToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var path = value as Tray.Location[];
            return (path != null && targetType == typeof (string)) ? path.AsString() : null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
